Exclusion control

ABSTRACT

An exclusion controller which allows an information processing unit to acquire a contended resource to the exclusion of the other information processing units includes a plurality of non-prioritized information processing units mutually exclusively acquiring a non-prioritized exclusion right, which indicates a candidate for acquiring the contended resource, by a first process. The exclusion controller further includes a prioritized information processing unit acquiring the contended resource by a second process, which requires a shorter processing time than the first process, to the exclusion of the non-prioritized information processing unit having acquired the non-prioritized exclusion right.

FIELD OF INVENTION

The present invention relates to an exclusion controller, an exclusioncontrol method, a program, and a recording medium. In particular, thepresent invention relates to an exclusion controller, an exclusioncontrol method, a program, and a recording medium, which give priorityfor acquiring a contended resource to a specific information processingunit.

BACKGROUND OF THE INVENTION

In recent years, multiprocessors and multithreads are used astechnologies for causing a computer to execute a plurality of tasks inparallel and for causing a plurality of processors to cooperativelyexecute a task at a high speed. In these technologies, a plurality ofinformation processing units, such as processors or threads, share acontended resource such as a memory or an input/output device.

Heretofore, a method for enabling high-speed acquisition and release ofa contended resource by changing an algorithm used for arbitration ofthe contention depending on whether the degree of contention isrelatively low or high when the arbitration for the contended resourceis performed, has been proposed (refer to nonpatent literature 1).According to the method disclosed in nonpatent literature 1, a contendedresource, in particular, can be acquired and released at a high speedcompared to other methods.

(Nonpatent Literature 1)

Tamiya Onodera and Kiyokuni Kawachiya: “A Study of Locking Objects withBimodal Fields,” in Proceedings of OOPSLA '99.

However, there are cases where only a specific information processingunit among a plurality of information processing units frequentlyacquires and releases a contended resource. According to knowntechnologies, even in such cases, the specific information processingunit needs to execute a process while operating to the exclusion of theother information processing units in the acquisition of the contendedresource. This has made it difficult to improve a processing speed.

SUMMARY OF THE INVENTION

Accordingly, the present invention provides an exclusion controller, anexclusion control method, a program, and a recording medium, which solvethe above-described problem. Specifically, a first aspect of the presentinvention provides an exclusion controller which allows an informationprocessing unit to acquire a contended resource to the exclusion ofother information processing units. In an example embodiment, theexclusion controller includes: a plurality of non-prioritizedinformation processing units mutually exclusively acquiring anon-prioritized exclusion right, which indicates a candidate foracquiring the contended resource, by a first process; and a prioritizedinformation processing unit acquiring the contended resource by a secondprocess, which requires a shorter processing time than the firstprocess, to the exclusion of the non-prioritized information processingunit having acquired the non-prioritized exclusion right.

A second aspect of the present invention provides an exclusioncontroller which allows any one of a plurality of threads capable ofacquiring an identical contended resource to acquire the contendedresource to the exclusion of the other threads different from therelevant thread. The exclusion controller includes: an execution stateacquisition/notification unit for acquiring execution locationinformation indicating an execution location of a program in a firstthread of the threads and for notifying a second thread different fromthe first thread of the execution location information; and an executionstate setting unit for allowing the second thread to execute a processfor setting, in the first thread, execution location informationindicating that the contended resource is not being acquired if theacquired execution location information indicates that the contendedresource is being acquired. Further, the second aspect of the presentinvention provides an exclusion control method, a program for realizingthe method, and a recording medium having the program recorded thereon.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present invention and theadvantages thereof, reference is now made to the following descriptiontaken in conjunction with the accompanying drawings, in which:

FIG. 1 is a function block diagram of an exclusion controller 10 in afirst embodiment;

FIG. 2 is a view showing details of a flat lock storage unit 100 in thefirst embodiment;

FIG. 3 is an operation flowchart where a prioritized informationprocessing unit 150 or a non-prioritized information processing unit 160tries to acquire a contended resource in the first embodiment;

FIG. 4 is an operation flowchart showing details of S100A and S100B inFIG. 3;

FIG. 5 is an operation flowchart showing details of S170 in FIG. 3;

FIG. 6 is an operation flowchart where the prioritized informationprocessing unit 150 or the non-prioritized information processing unit160 releases the contended resource;

FIG. 7 is a function block diagram of an exclusion controller 10 in amodified example of the first embodiment;

FIG. 8 is a view showing details of a flat lock storage unit 100 in themodified example of the first embodiment;

FIG. 9 is an operation flowchart where a prioritized informationprocessing unit 150 or a non-prioritized information processing unit 160tried to acquire a contended resource in the modified example of thefirst embodiment;

FIG. 10 is a function block diagram of an exclusion controller 20 in asecond embodiment;

FIG. 11 is a view showing details of a resource information storage area300 in the second embodiment;

FIG. 12 is an operation flowchart where a prioritized informationprocessing unit 340 or a non-prioritized information processing unit 350tries to acquire a contended resource in the second embodiment;

FIG. 13 is an operation flowchart showing details of S880 in FIG. 12;

FIG. 14 is an operation flowchart where the prioritized informationprocessing unit 340 or the non-prioritized information processing unit350 releases the contended resource in the second embodiment;

FIG. 15 is an operation flowchart showing details of S880 in a modifiedexample of the second embodiment; and

FIG. 16 is a view showing an example of the hardware configuration ofthe exclusion controller 10.

DETAILED DESCRIPTION OF THE INVENTION

The present invention provides an exclusion controller, an exclusioncontrol method, a program, and a recording medium. In an embodiment, thepresent invention provides an exclusion controller which allows aninformation processing unit to acquire a contended resource to theexclusion of other information processing units. The exclusioncontroller includes: a plurality of non-prioritized informationprocessing units mutually exclusively acquiring a non-prioritizedexclusion right, which indicates a candidate for acquiring the contendedresource, by a first process; and a prioritized information processingunit acquiring the contended resource by a second process, whichrequires a shorter processing time than the first process, to theexclusion of the non-prioritized information processing unit havingacquired the non-prioritized exclusion right. Thus, the presentinvention provides an exclusion control method, a program for realizingthe method, and a recording medium having the program recorded thereon.

Moreover, the present invention provides an exclusion controller whichallows any one of a plurality of threads capable of acquiring anidentical contended resource to acquire the contended resource to theexclusion of the other threads different from the relevant thread. Theexclusion controller includes: an execution stateacquisition/notification unit for acquiring execution locationinformation indicating an execution location of a program in a firstthread of the threads and for notifying a second thread different fromthe first thread of the execution location information; and an executionstate setting unit for allowing the second thread to execute a processfor setting, in the first thread, execution location informationindicating that the contended resource is not being acquired if theacquired execution location information indicates that the contendedresource is being acquired. Further, the second aspect of the presentinvention provides an exclusion control method, a program for realizingthe method, and a recording medium having the program recorded thereon.

Hereinafter, the present invention will be described through particularexample embodiments thereof. However, the embodiments below are notintended to limit the invention according to the appended claims.Moreover, all combinations of features described in the embodiments arenot always necessary for solving means of the invention.

First Embodiment

FIG. 1 shows a function block diagram of an exclusion controller 10 in afirst embodiment. The exclusion controller 10 has an object to arbitratethe acquisition of a contended resource 50 by allowing any one of aplurality of information processing units operating parallel to oneanother, for example, a prioritized information processing unit 150 andnon-prioritized information processing units 160-1 to 160-N, to acquirethe contended resource 50 to the exclusion of the other informationprocessing units.

The exclusion controller 10 comprises the contended resource 50 to beacquired by any one of the plurality of information processing units, aflat lock storage unit 100 used when the degree of contention for thecontended resource 50 is relatively low, a prioritized informationprocessing unit setting unit 140 for setting one of the plurality ofinformation processing units as the prioritized information processingunit 150, the prioritized information processing unit 150 given priorityin acquisition of the contended resource 50, non-prioritized informationprocessing units 160-1 to 160-N, an acquisition check unit 170 forchecking the degree of contention for the contended resource, aprioritized information processing unit change unit 180 for changing theprioritized information processing unit 150, a monitor control unit 190used when the degree of contention for the contended resource 50 isrelatively high, a fat lock storage unit 200, and a full stop unit 210for temporarily stopping the operations of all the informationprocessing units.

Each of the non-prioritized information processing units 160-1 to 160-Nexecutes, as an example of a first process, a process for writing on theflat lock storage unit 100 to the exclusion of the other non-prioritizedinformation processing units, thereby acquiring and releasing anon-prioritized exclusion right, which is a right to be a candidate foracquiring the contended resource 50. For example, each of thenon-prioritized information processing units 160-1 to 160-N executesexclusive writes by a compare-and-swap instruction requiring arelatively long processing time. On the other hand, the prioritizedinformation processing unit 150 set by the prioritized informationprocessing unit setting unit 140 executes, as an example of a secondprocess requiring a shorter processing time than the first process, aprocess for writing on the flat lock storage unit 100 by, for example, anormal write instruction, thereby acquiring and releasing the contendedresource 50. The exclusion controller 10 allows any one of theprioritized information processing unit 150 and the non-prioritizedinformation processing unit 160 which has acquired the non-prioritizedexclusion right, to acquire the contended resource 50.

As described above, the exclusion controller 10 can allow theprioritized information processing unit 150 to acquire the contendedresource 50 by using the second process faster than the first process.Accordingly, the exclusion controller 10 can allow the prioritizedinformation processing unit 150 to acquire the contended resource 50faster than the non-prioritized information processing unit 160. Forexample, when it is previously predicted that the prioritizedinformation processing unit 150 has a higher frequency of acquiring thecontended resource 50 than the other information processing units, theexclusion controller 10 can execute an arbitration process regarding theacquisition of the contended resource 50 at a high speed.

The contended resource 50 is a resource to be exclusively acquired byany one of the prioritized information processing unit 150 and thenon-prioritized information processing units 160-1 to 160-N, whichasynchronously operate. For example, the contended resource 50 is amemory area which is shared by the prioritized information processingunit 150 and the non-prioritized information processing units 160-1 to160-N and stores the total number of times that the resource has beenacquired. The necessity of exclusively accessing this memory area willbe described below.

The memory area can store the total number of times that the contendedresource 50 has been acquired, in the case where the following incrementprocess is executed when any one of the prioritized informationprocessing unit 150 and the non-prioritized information processing units160-1 to 160-N has acquired the contended resource: a counter is readfrom the memory area, a new value is generated by adding one to the readcounter, and the new value is written to the memory area.

However, if another information processing unit which has not acquiredthe contended resource is allowed to execute an increment processparallel to the above-described increment process, there may be caseswhere the memory area stores a value less than the total number of timesthat the contended resource 50 has been acquired. Specifically, if theanother information processing unit initiates and terminates anincrement process after the information processing unit, which hasacquired the contended resource, has read the counter and before theinformation processing unit writes a new value, the result written bythe another information processing unit is overwritten and destroyed bythe new value generated by the information processing unit havingacquired the contended resource. Therefore, in order to correctly keepthe total number of times that the contended resource 50 has beenacquired, the contended resource 50 needs to be exclusively acquired byeach of the plurality of information processing units.

Incidentally, instead of a memory area as described above, the contendedresource 50 may be any one of the following: an input/output deviceprovided in a computer or the like, a communication channel connected toa communication device, and an instruction sequence to be exclusivelyexecuted. In other words, the contended resource 50 may be a device orthe like which causes problems in operations when the deviceconcurrently receives directions from a plurality of informationprocessing units.

The flat lock storage unit 100 is provided so as to correspond to thecontended source 50, and stores information indicating which informationprocessing unit has acquired the contended resource 50. The flat lockstorage unit 100 has a prioritized information processing unitinformation storage area 110, a prioritized exclusion right storage area120, and a non-prioritized exclusion right storage area 130.

The prioritized information processing unit information storage area 110stores prioritized information processing unit identificationinformation indicating which information processing unit is theprioritized information processing unit 150. For example, theprioritized information processing unit information storage area 110stores either anonymous state information indicating that any of theinformation processing units is not the prioritized informationprocessing unit 150, or identification information for identifying theprioritized information processing unit 150.

The prioritized exclusion right storage area 120 stores “locked” asprioritized exclusion right information indicating that the prioritizedinformation processing unit 150 is trying to acquire the contendedresource 50. On the other hand, when the prioritized informationprocessing unit 150 is not trying to acquire the contended resource 50,the prioritized exclusion right storage area 120 stores “unlocked.”

The non-prioritized exclusion right storage area 130 stores, asnon-prioritized exclusion right information identifying which of thenon-prioritized information processing units 160-1 to 160-N has acquiredthe non-prioritized exclusion right, identification information foridentifying the non-prioritized information processing unit 160. On theother hand, when any of the non-prioritized information processing units160-1 to 160-N has not acquired the non-prioritized exclusion right, thenon-prioritized exclusion right storage area 130 stores “nobody.”

When the prioritized information processing unit setting unit 140receives, from any one of the prioritized information processing unit150 and the non-prioritized information processing units 160-1 to 160-N,directions to set the information processing unit as the prioritizedinformation processing unit, the prioritized information processing unitsetting unit 140 executes the following process to the exclusion of theother information processing units except the sender of the directions.If identification information for identifying the prioritizedinformation processing unit 150 is not stored in the prioritizedinformation processing unit information storage area 110, that is, ifanonymous state information is stored therein, the prioritizedinformation processing unit setting unit 140 stores, in the prioritizedinformation processing unit information storage area 110, identificationinformation for identifying the information processing unit which hasgiven the directions to the prioritized information processing unitsetting unit 140.

The non-prioritized information processing units 160-1 to 160-N are, forexample, units of processing which are managed by an operating system ora language processor and may operate asynchronously, specifically,threads or processes. As another example, each of the non-prioritizedinformation processing units 160-1 to 160-N may be a central processorof a computer.

When the non-prioritized information processing units 160-1 to 160-Nreceive directions to acquire the contended resource 50 from a programor the like created by a user, the non-prioritized informationprocessing units 160-1 to 160-N mutually exclusively acquire thenon-prioritized exclusion right, which indicates a candidate foracquiring the contended resource 50, by using the first process. Forexample, the non-prioritized information processing unit 160-1 executesthe following process as the first process to the exclusion of thenon-prioritized information processing units 160-2 to 160-N. Ifnon-prioritized exclusion right information has not yet stored in thenon-prioritized exclusion right storage area 130, that is, if “nobody”is stored therein, the non-prioritized information processing unit 160-1writes non-prioritized exclusion right information indicating that thenon-prioritized information processing unit 160-1 has acquired anon-prioritized exclusion right, in the non-prioritized exclusion rightstorage area 130.

To be more specific, the non-prioritized information processing unit160-1 executes the first process by using an indivisible instruction(atomic instruction), such as a compare-and-swap instruction, whichexclusively executes a read, a check, and a write without beinginterrupted by processes of the other information processing units.Instead of this, the non-prioritized information processing unit 160-1may execute the first process by using any one of the following: atest-and-set instruction, a lock instruction which locks a bus used forwriting on a memory, and an LL instruction or an SC instruction which isprovided in, for example, a MIPS (trademark) processor and checkswhether other information processing unit has written to a memory havingstored a read value.

Moreover, if an anonymous state is stored in the prioritized informationprocessing unit information storage area 110, the non-prioritizedinformation processing unit 160-1 transmits directions to set thenon-prioritized information processing unit 160-1 as the prioritizedinformation processing unit, to the prioritized information processingunit setting unit 140. Operations of the non-prioritized informationprocessing units 160-2 to 160-N are almost the same as those of thenon-prioritized information processing unit 160-1. Therefore, adescription thereof will be omitted.

Further, when the non-prioritized information processing unit 160-1receives directions to release the contended resource 50, from a programor the like created by a user, the non-prioritized informationprocessing unit 160-1 writes “nobody” in the non-prioritized exclusionright storage area 130, thereby releasing the contended resource 50.Note that, in transition to a fat state in which the contended resource50 is acquired in a monitor mode to be described later, thenon-prioritized information processing unit 160-1 once acquires thecontended resource 50 by using the monitor mode and then executes aprocess for releasing the contended resource 50 as needed.

Moreover, in the fat state, the non-prioritized information processingunit 160-1 acquires the contended resource 50 by transmitting directionsto acquire the contended resource 50 to the monitor control unit 190.Similarly, in the fat state, the non-prioritized information processingunit 160-1 releases the contended resource 50 by transmitting directionsto release the contended resource 50 to the monitor control unit 190.

Similar to the non-prioritized information processing units 160-1 to160-N, the prioritized information processing unit 150 is a unit ofprocessing, such as a thread or a process. Realized examples of theprioritized information processing unit 150 are almost the same as thoseof the non-prioritized information processing unit 160. Therefore, adescription thereof will be omitted.

The prioritized information processing unit 150 acquires the contendedresource 50 by executing, as described below, the second processrequiring a shorter processing time than the first process, to theexclusion of the non-prioritized information processing unit 160 havingacquired the non-prioritized exclusion right. First, the prioritizedinformation processing unit 150 stores “locked” in the prioritizedexclusion right storage area 120. Next, the prioritized informationprocessing unit 150 reads the non-prioritized exclusion rightinformation stored in the non-prioritized exclusion right storage area130. If non-prioritized exclusion right information has been alreadystored therein, that is, if any one of the non-prioritized informationprocessing units 160-1 to 160-N has already acquired the non-prioritizedexclusion right, the prioritized information processing unit 150 removes“locked” from the prioritized exclusion right storage area 120 to store“unlocked” therein, and then executes another process (e.g. a processfor retrying to acquire the contended resource 50). On the other hand,if non-prioritized exclusion right information has not yet been stored,that is, if any of the non-prioritized information processing units160-1 to 160-N has not acquired the non-prioritized exclusion right, theprioritized information processing unit 150 acquires the contendedresource 50 to execute a process using the contended resource 50.

When the prioritized information processing unit 150 receives directionsto release the contended resource 50, from a program or the like createdby a user, the prioritized information processing unit 150 releases thecontended resource 50 by removing “locked” from the prioritizedexclusion right storage area 120 to store “unlocked” therein. Note thata process for releasing the contended resource 50 in the fat state isalmost the same as that of the non-prioritized information processingunit 160-1 and therefore a description thereof will be omitted.

The acquisition check unit 170 checks whether the acquisition of thecontended resource 50 has failed, based on the first or second processexecuted by an information processing unit. If “locked” is stored in theprioritized exclusion right storage area 120, the acquisition check unit170 checks whether the non-prioritized exclusion right is stored in thenon-prioritized exclusion right storage area 130. If the acquisitioncheck unit 170 checks that the non-prioritized exclusion right is storedin the non-prioritized exclusion right storage area 130, the acquisitioncheck unit 170 checks that the acquisition of the contended resource 50by the first process has failed. The acquisition check unit 170 thentransmits information indicating that the acquisition of the contendedresource 50 has failed, to the prioritized information processing unitchange unit 180 and the monitor control unit 190.

When the prioritized information processing unit change unit 180receives the information indicating that the acquisition of thecontended resource 50 has failed from the acquisition check unit 170,the prioritized information processing unit change unit 180 storesanonymous state information in the prioritized information processingunit information storage area 110, thereby changing the prioritizedinformation processing unit 150 into the non-prioritized informationprocessing unit 160. Moreover, when the prioritized informationprocessing unit change unit 180 receives directions to change theprioritized information processing unit, from the full stop unit 210,the prioritized information processing unit change unit 180 specifiesthe information processing unit having acquired the contended resource50 by referring to the flat lock storage unit 100. Then, the prioritizedinformation processing unit change unit 180 writes, on the flat lockstorage unit 100, information indicating that the specified informationprocessing unit is set as the prioritized information processing unit,thereby changing the specified information processing unit into theprioritized information processing unit. The prioritized informationprocessing unit change unit 180 determines the information processingunit to be changed into the prioritized information processing unit inthe state where operations of the information processing units arestopped by the full stop unit 210. However, instead of this, theprioritized information processing unit change unit 180 may determinethe information processing unit to be changed into the prioritizedinformation processing unit by periodically referring to the flat lockstorage unit 100 without stopping operations of the informationprocessing units.

When the monitor control unit 190 receives the information indicatingthat the acquisition of the contended resource 50 has failed from theacquisition check unit 170, the monitor control unit 190 executes asubsequent arbitration process regarding the acquisition of thecontended resource 50 by using a monitor mode, an example of which willbe described below. In the monitor mode, the fat lock storage unit 200has recorded identification information of all the informationprocessing units which are waiting for the contended resource 50 to bereleased by another information processing unit in order to acquire thecontended resource 50. Specifically, when the monitor control unit 190receives directions to acquire the contended resource 50, from any oneof the prioritized information processing unit 150 and thenon-prioritized information processing units 160-1 to 160-N, the monitorcontrol unit 190 registers information for identifying the informationprocessing unit having transmitted the directions, as the identificationinformation of the information processing unit waiting for the releaseof the contended resource 50, in the fat lock storage unit 200. Theexclusion controller 10 does not allocate a computational resource, suchas a CPU, to these waiting information processing units. Accordingly,the entire system is in a state where the computational resource isefficiently utilized.

When the monitor control unit 190 receives directions to release thecontended resource 50, from an information processing unit, the monitorcontrol unit 190 selects the information processing unit which satisfiesa predetermined condition, for example, the information processing unitwhich has first started waiting, among the information processing unitswaiting in order to acquire the contended resource 50, thus allowing theselected information processing unit to acquire the contended resource50.

Incidentally, when the monitor control unit 190 receives the informationindicating that the acquisition of the contended resource 50 has failedfrom the acquisition check unit 170, the monitor control unit 190 mayexecute a subsequent arbitration process regarding the acquisition ofthe contended resource 50 by using another arbitrary locking methodinstead of the above-described process. For example, a locking methodwhich is provided as standard in the operating system managing theexclusion controller 10 may be used.

As described above, when the monitor control unit 190 allows aninformation processing unit to try to acquire the contended resource 50,the monitor control unit 190 registers a waiting state and the like inthe fat lock storage unit 200. Accordingly, a long processing time isrequired for completing an acquisition check after acquisition isattempted, compared to the acquisition of the contended resource 50 byusing the flat lock storage unit 100. However, when there are relativelymany information processing units which are waiting in order to acquirethe contended resource 50, the monitor control unit 190 does notallocate the computational resource to these waiting informationprocessing units, thereby improving the utilization ratio of thecomputational resource in the whole system.

In the subsequent description, the acquisition of the contended resource50 using the flat lock storage unit 100 is referred to as flat lock, andthe acquisition of the contended resource 50 using the fat lock storageunit 200 is referred to as fat lock, as names according to theabove-described characteristics. Moreover, a state where all theinformation processing units use the fat lock in order to acquire thecontended resource 50 is referred to as a fat state or a weighing mode,and a state where all the information processing units use the flat lockin order to acquire the contended resource 50 is referred to as a flatstate or a priority mode.

Incidentally, a locking method used in the fat state is not limited tothe aforementioned monitor mode. If the degree of contention is higherthan that in the acquisition of the contended resource 50 by using theflat lock storage unit 100 by a predetermined degree, for example, ifthe frequency of contention is a predetermined value or more, themonitor control unit 190 may allow an information processing unit toacquire the contended resource 50 by using a method of fasteroperations.

The fat lock storage unit 200 acquires data necessary for the monitormode used by the monitor control unit 190. The fat lock storage unit 200typically stores information for identifying the information processingunit having acquired the contended resource 50 and informationindicating which of the information processing units are waiting inorder to acquire the contended resource 50. For example, the fat lockstorage unit 200 may manage the information indicating the informationprocessing units waiting in order to acquire the contended resource 50in the order of wait initiation time by connecting the information to afirst-in first-out (FIFO) queue. In this case, the fat lock storage unit200 may remove the information indicating an information processing unitfrom the queue or may newly add the information indicating aninformation processing unit to the queue in accordance with directionsfrom the monitor control unit 190.

The full stop unit 210 periodically stops operations of the prioritizedinformation processing unit 150 and the non-prioritized informationprocessing units 160-1 to 160-N. For example, when the exclusioncontroller 10 uses a garbage collection (abbreviated to GC) function tomanage a memory, the full stop unit 210 periodically stops operations ofthe prioritized information processing unit 150 and the non-prioritizedinformation processing units 160-1 to 160-N in order to executestop-the-world GC. In addition to executing GC, the full stop unit 210transmits directions to change the prioritized information processingunit to the prioritized information processing unit change unit 180.

As described above, the exclusion controller 10 can allow theprioritized information processing unit 150 to acquire the contendedresource 50 at a high speed. Accordingly, if the prioritized informationprocessing unit 150 has a higher frequency of acquiring the contendedresource 50 than the other information processing units, an arbitrationprocess regarding the acquisition of the contended resource 50 can beexecuted at a high speed.

FIGS. 2A to 2E show details of the flat lock storage unit 100 in thefirst embodiment. The flat lock storage unit 100 includes theprioritized information processing unit information storage area 110 forstoring information for identifying the prioritized informationprocessing unit, the prioritized exclusion right storage area 120 forstoring prioritized exclusion right information, and the non-prioritizedexclusion right storage area 130 for storing non-prioritized exclusionright information. The information for identifying the prioritizedinformation processing unit and the non-prioritized exclusion rightinformation may be, for example, thread IDs of information processingunits which are managed by an operating system, or may be thread IDs ofinformation processing units which are managed by a language processorfor operating the exclusion controller 10. Moreover, the prioritizedexclusion right information is, for example, binary informationindicating whether the prioritized information processing unit 150 istrying to acquire the contended resource 50.

FIG. 2A shows an example of the flat lock storage unit 100 at the timewhen the contended resource 50 is initialized. The prioritizedinformation processing unit information storage area 110 stores“anonymous state” indicating that none of the information processingunits is the prioritized information processing unit 150. Moreover, theprioritized exclusion right storage area 120 stores “unlocked”indicating that the prioritized information processing unit 150 is nottrying to acquire the contended resource 50. Further, thenon-prioritized exclusion right storage area 130 stores “nobody”indicating that none of the information processing units has acquiredthe non-prioritized exclusion right.

FIG. 2B shows the state where the prioritized information processingunit 150 has been set by the prioritized information processing unitsetting unit 140 in FIG. 2A. The prioritized information processing unitinformation storage area 110 stores ID1, which is information foridentifying the prioritized information processing unit 150. FIG. 2Cshows the state where the acquisition of the contended resource 50 hasbeen tried by the prioritized information processing unit 150 in FIG.2B. The prioritized exclusion right storage area 120 stores “locked”indicating that the acquisition of the contended resource 50 has beentried by the prioritized information processing unit 150. FIG. 2D showsthe state where the non-prioritized exclusion right has been acquired bythe non-prioritized information processing unit 160-1 in FIG. 2B. Thenon-prioritized exclusion right storage area 130 stores ID2. This ID2indicates that the non-prioritized exclusion right has been acquired bythe information processing unit identified by the identificationinformation of ID2, e.g. the non-prioritized information processing unit160-1.

FIG. 2E shows the state where the acquisition of the contended resource50 has been tried by the prioritized information processing unit 150 inFIG. 2D, and also the state where the non-prioritized exclusion righthas been acquired by the non-prioritized information processing unit160-1 in the state shown in FIG. 2C. The prioritized exclusion rightstorage area 120 stores “locked,” and the non-prioritized exclusionright storage area 130 stores “ID2” indicating that the non-prioritizedexclusion right has been acquired by the non-prioritized informationprocessing unit 160-1. Two cases leading to the state of FIG. 2E will bedescribed in order.

In the state shown in FIG. 2D, the prioritized information processingunit 150 stores “locked” in the prioritized exclusion right storage area120 in order to acquire the contended resource 50 in response todirections or the like from a user program. The state at this point isshown in FIG. 2E. Thereafter, the prioritized information processingunit 150 reads non-prioritized exclusion right information stored in thenon-prioritized exclusion right storage area 130. The prioritizedinformation processing unit 150 checks that non-prioritized exclusionright information has been already stored therein, i.e. that thenon-prioritized information processing unit 160-1 has already acquiredthe non-prioritized exclusion right. The prioritized informationprocessing unit 150 then removes “locked” from the prioritized exclusionright storage area 120 to store “unlocked” therein, thereby canceling anattempt to acquire the contended resource 50 (return to the state ofFIG. 2D).

In the state shown in FIG. 2C, when the non-prioritized informationprocessing unit 160-1 receives directions to acquire the contendedresource 50, from a user program or the like, the non-prioritizedinformation processing unit 160-1 stores “ID2” in the non-prioritizedexclusion right storage area 130 to the exclusion of the non-prioritizedinformation processing units 160-2 to 160-N. The state at this point isshown in FIG. 2E. Thereafter, the non-prioritized information processingunit 160-1 removes “ID2” stored in the non-prioritized exclusion rightstorage area 130, thereby releasing the non-prioritized exclusion right(return to the state of FIG. 2C).

As described above, the flat lock storage unit 100 has the prioritizedexclusion right storage area 120, in which only the prioritizedinformation processing unit 150 writes, and the non-prioritizedexclusion right storage area 130, in which the non-prioritizedinformation processing units 160-1 to 160-N write, individually.Therefore, since the prioritized information processing unit 150 neednot write in the prioritized exclusion right storage area 120 to theexclusion of the other information processing units, the prioritizedinformation processing unit 150 can operate at a high speed.

FIG. 3 shows an operation flow where the prioritized informationprocessing unit 150 or the non-prioritized information processing unit160 tries to acquire the contended resource in the first embodiment. Theprioritized information processing unit 150 and the non-prioritizedinformation processing units 160-1 to 160-N can concurrently operate inaccordance with the operation flows shown in FIGS. 3 to 6. Moreover, inFIG. 3, the prioritized information processing unit 150 and thenon-prioritized information processing units 160-1 to 160-N operate inalmost the same manner. Therefore, the prioritized informationprocessing unit 150 and the non-prioritized information processing units160-1 to 160-N are generically named information processing units in thedescription below.

An information processing unit tries to acquire the flat lock by usingthe first process and/or the second process in order to acquire thecontended resource 50 (S100A). Details thereof will be described later.If the flat lock has been successfully acquired (S110: YES), theinformation processing unit acquires the contended resource 50 toexecute a process using the contended resource 50 (S120).

On the other hand, if the acquisition check unit 170 has failed toacquire the flat lock (S110: NO), the monitor control unit 190 allowsthe information processing unit to wait until the information processingunit acquires the fat lock (S130). After the information processing unithas acquired the fat lock, the information processing unit checkswhether the transition to the fat state has been completed (S140).Details of the check as to whether the transition to the fat state hasbeen completed will be described later in the description of S170. Ifthe information processing unit has checked that the transition to thefat state has been completed (S140: YES), the information processingunit acquires the contended resource 50 by the fat lock to execute aprocess using the contended resource 50 (S120).

On the other hand, if the information processing unit has checked thatthe transition to the fat state has not yet been completed (S140: NO),the information processing unit sets the contended resource 50 to be ina flat lock contention state, which indicates that the acquisition ofthe flat lock has failed and the transition to the fat state has notbeen completed (S150). For example, the information processing unitwrites information indicating the flat lock contention state in apredetermined area on a memory accessible by all the informationprocessing units, thereby setting the contended resource 50 to be in theflat lock contention state.

Subsequently, the information processing unit tries to acquire the flatlock by using the first process and/or the second process (S100B). Ifthe flat lock has been successfully acquired (S160: YES), theinformation processing unit sets the contended resource 50 to be in thefat state (S170), and returns to S140. Details of S170 will be describedlater.

On the other hand, if the acquisition of the flat lock has failed (S160:NO), the information processing unit releases the fat lock alreadyacquired in S130 to wait until the information processing unit receivesa lock state change notice from another information processing unit(S180). Thereafter, if the information processing unit has received alock state change notice from another information processing unit, theinformation processing unit again acquires the fat lock to return to theprocess of S140.

As described above, the exclusion controller 10 allows the informationprocessing unit having acquired both the flat lock and the fat lock toexecute the transition process from the flat state to the fat state.Accordingly, the exclusion controller 10 can avoid disorder or the likein which both the flat lock and the fat lock coexist as locks foracquiring the contended resource 50, in the transition process from theflat lock to the fat lock.

FIG. 4 is an operation flow showing details of S100A and S100B in FIG.3. If the information processing unit executing S100 checks that theinformation processing unit is the prioritized information processingunit 150 (S200: YES), the information processing unit stores “locked” inthe prioritized exclusion right storage area 120 (S210). Then, ifnon-prioritized exclusion right information is not stored in thenon-prioritized exclusion right storage area 130, that is, if “nobody”is stored therein (S220: NO), the prioritized information processingunit 150 acquires the contended resource 50 (S240), and the processcomes to an end.

On the other hand, if non-prioritized exclusion right information hasbeen already stored in the non-prioritized exclusion right storage area130 (S220: YES), that is, if any one of the non-prioritized informationprocessing units 160-1 to 160-N has already acquired the non-prioritizedexclusion right, the acquisition check unit 170 removes “locked” storedin the prioritized exclusion right storage area 120 (S250). Theprioritized information processing unit change unit 180 then setsprioritized information processing unit information to an anonymousstate by storing anonymous state information in the prioritizedinformation processing unit information storage area 110 (S260), anddoes not allow the prioritized information processing unit 150 toacquire the contended resource 50 (S270), and then the process comes toan end.

On the other hand, if the information processing unit executing S100 haschecked that the information processing unit is any one of thenon-prioritized information processing units, e.g. the non-prioritizedinformation processing unit 160-1 (S200: NO), the information processingunit checks whether the prioritized information processing unitinformation stored in the prioritized information processing unitinformation storage area 110 indicates an anonymous state (S280). If theprioritized information processing unit information indicates ananonymous state (S280: YES), the prioritized information processing unitsetting unit 140 executes a process for setting the non-prioritizedinformation processing unit 160-1 as the prioritized informationprocessing unit to the exclusion of the other non-prioritizedinformation processing units, that is, a process for writing, in theprioritized information processing unit information storage area 110,the prioritized information processing unit information indicating thatthe non-prioritized information processing unit 160-1 is the prioritizedinformation processing unit (S290), and then the process returns toS200. In other words, the prioritized information processing unitsetting unit 140 sets as the prioritized information processing unit 150the information processing unit having first acquired the contendedresource 50 after initialization thereof, and sets as thenon-prioritized information processing units 160 the other informationprocessing units except the prioritized information processing unit 150.

If the prioritized information processing unit information is not in ananonymous state (S280: NO), the non-prioritized information processingunit 160-1 executes a process for acquiring the non-prioritizedexclusion right to the exclusion of the other non-prioritizedinformation processing units (S300).

If the acquisition of the non-prioritized exclusion right has failed(S310: NO), the non-prioritized information processing unit 160-1 cannotacquire the contended resource 50 (S270), and the process comes to anend. On the other hand, if the non-prioritized exclusion right has beensuccessfully acquired (S310: YES), the non-prioritized informationprocessing unit 160-1 checks whether “locked” has been already stored inthe prioritized exclusion right storage area 120 (S320). If “locked” isnot stored therein (S320: NO), the non-prioritized informationprocessing unit 160-1 acquires the contended resource 50 (S240), and theprocess comes to an end. On the other hand, if “locked” is storedtherein (S320: YES), the non-prioritized information processing unit160-1 removes the information indicating the non-prioritized exclusionright from the prioritized exclusion right storage area 120 (S330). Inthis case, the non-prioritized information processing unit 160-1 cannotacquire the contended resource 50 (S270), and the process comes to anend.

As described above, the non-prioritized information processing unit160-1 executes, as the first process, a process (e.g. S200, S280, S300,S310, S320, and S240) for storing non-prioritized exclusion rightinformation indicating that the non-prioritized information processingunit has acquired the non-prioritized exclusion right, to the exclusionof the other non-prioritized information processing units ifnon-prioritized exclusion right information has not been stored. On theother hand, the prioritized information processing unit 150 can acquirethe contended resource 50 by executing, as the second process requiringa shorter processing time than the first process, a process (e.g. S200,S210, S220, and S240) for storing “locked” in the prioritized exclusionright storage area 120.

FIG. 5 shows an operation flow showing details of S170 in FIG. 3. Theinformation processing unit resets the flat lock contention state(S400). Next, the information processing unit notifies all theinformation processing units waiting for a lock state change notice toarrive (e.g. S180 of FIG. 3) of the change of the lock state (S410).Then, the information processing unit sets the contended resource 50 tothe fat state (S420).

The process for setting the contended resource 50 to the fat state is,for example, a process for writing information indicating the fat statein a predetermined area (e.g. the flat lock storage unit 100) on amemory which is accessible by all the information processing unitscapable of acquiring the contended resource 50 and is provided so as tocorrespond to the contended resource 50. Therefore, the otherinformation processing units can check whether the contended resource 50is currently in the fat state, by referring to the predetermined area(e.g. S140 of FIG. 3).

FIG. 6 shows an operation flow where the prioritized informationprocessing unit 150 or the non-prioritized information processing unit160 releases the contended resource 50. First, the informationprocessing unit checks whether the contended resource 50 is in the flatstate, by referring to the flat lock storage unit 100 (S500). If theinformation processing unit has checked that the contended resource 50is not in the flat state (S500: NO), the information processing unitchecks whether a condition for the transition from the fat state to theflat state is satisfied, e.g., whether there is an informationprocessing unit waiting in order to acquire the contended resource 50(S510).

If the condition for the transition from the fat state to the flat stateis not satisfied (S510: NO), the information processing unit executes aprocess for releasing the fat lock by using the monitor control unit 190(S520). On the other hand, if the condition for the transition from thefat state to the flat state is satisfied (S510: YES), the informationprocessing unit initializes the flat lock storage unit 100 (S530), andsets the state for acquiring the contended resource 50 to the flat state(S540).

Incidentally, when the information processing unit initializes the flatlock storage unit 100, the prioritized information processing unit maybe set to be in an anonymous state. In this case, the informationprocessing unit can set, as the prioritized information processing unit150, the information processing unit first acquiring the contendedresource 50 after the transition to the flat lock.

On the other hand, if the information processing unit has checked thatthe contended resource 50 is in the flat state (S500: YES), theinformation processing unit executes a process for releasing the flatlock, e.g., a process for storing information indicating that theinformation processing unit has released the contended resource 50, inthe prioritized exclusion right storage area 120 or the non-prioritizedexclusion right storage area 130 (S550). Subsequently, the informationprocessing unit checks whether the contended resource 50 is set to theflat lock contention state (S560). If the contended resource 50 is notset to be in the flat lock contention state (S560: NO), the releasingprocess comes to an end. On the other hand, if the contended resource 50is set to be in the flat lock contention state, the informationprocessing unit tries to acquire the fat lock. Then, if the informationprocessing unit has acquired the fat lock (S570: YES), the informationprocessing unit again checks whether the contended resource 50 is set tobe in the flat lock contention state (S580). If the contended resource50 is set to be in the flat lock contention state (S580: YES), theinformation processing unit notifies any one of the other informationprocessing units waiting for a lock state change notice to arrive, ofthe change of the lock state (S590). Subsequently, the informationprocessing unit releases the fat lock (S520).

As described above, if the contended resource 50 is in the flat lockcontention state, which is the transition process from the flat lock tothe fat lock, the exclusion controller 10 once acquires both the flatlock and the fat lock and then releases both the locks. Therefore, evenin a transient state where both the flat lock and the fat lock coexistas locks for acquiring the contended resource 50, the contended resource50 can be appropriately released.

Modified Example

FIG. 7 shows a function block diagram of an exclusion controller 10 in amodified example of the first embodiment. Since the exclusion controller10 in FIG. 7 has almost the same configuration as that of the exclusioncontroller 10 shown in FIG. 1, only the differences therebetween will bedescribed. The exclusion controller 10 of the present modified exampleneed not include a prioritized information processing unit setting unit140, a prioritized information processing unit change unit 180, amonitor control unit 190, a fat lock storage unit 200, and a full stopunit 210, unlike the exclusion controller 10 shown in FIG. 1. Moreover,the flat lock storage unit 100 in FIG. 7 may have an area usage typestorage area 115, an exclusion right storage area 125, and aninformation processing unit identification information storage area 135,instead of the prioritized information processing unit informationstorage area 110, the prioritized exclusion right storage area 120, andthe non-prioritized exclusion right storage area 130 in the flat lockstorage unit 100 of FIG. 1, respectively. Here, the exclusion rightstorage area 125 is an example of a prioritized exclusion right storagearea according to the present invention, and the information processingunit identification information storage area 135 is an example of anon-prioritized exclusion right storage area according to the presentinvention.

The information processing unit identification information storage area135 stores any one of prioritized information processing unitinformation and non-prioritized exclusion right information. The areausage type storage area 115 stores area usage type informationindicating which of the prioritized information processing unitinformation and the non-prioritized exclusion right information theinformation processing unit identification information storage area 135stores. Note that, since the area usage type information is binaryinformation, the area usage type storage area 115 has a smaller sizethan that of the prioritized information processing unit informationstorage area 110 in FIG. 1.

The prioritized information processing unit 150 acquires the contendedresource 50 by storing “locked” in the exclusion right storage area 125,and releases the contended resource 50 by removing “locked” from theexclusion right storage area 125. If the information processing unitidentification information storage area 135 does not store theidentification information of the prioritized information processingunit 150 in the case where the prioritized information processing unit150 has stored “locked” in the exclusion right storage area 125, theacquisition check unit 170 writes “unlocked” in the exclusion rightstorage area 125, thereby canceling the acquisition of the contendedresource 50 by the prioritized information processing unit 150.

The non-prioritized information processing unit 160 acquires an accessright to the flat lock storage unit 100 to the exclusion of the otherinformation processing units, and executes the following process. If“locked” is not stored in the exclusion right storage area 125, thenon-prioritized information processing unit 160 stores theidentification information of the non-prioritized information processingunit 160 in the information processing unit identification informationstorage area 135, and stores “locked” in the exclusion right storagearea 125. Further, the non-prioritized information processing unit 160stores the area usage type information indicating that non-prioritizedexclusion right information is stored, in the area usage type storagearea 115.

As described above, if only the prioritized information processing unit150 acquires the contended resource 50, the prioritized informationprocessing unit 150 acquires the contended resource 50 at a high speedby writing in the exclusion right storage area 125. On the other hand,once the non-prioritized information processing unit 160 succeeds inacquiring the contended resource 50, the non-prioritized informationprocessing unit 160 allows the information processing unitidentification information storage area 135 to store non-prioritizedexclusion right information, thereby acquiring the contended resource 50to the exclusion of the other non-prioritized information processingunits. In this case, the prioritized information processing unit 150loses an originally possessed priority right to acquire the contendedresource 50, and acquires the contended resource 50 by acquiring thenon-prioritized exclusion right similarly to the non-prioritizedinformation processing unit 160.

FIGS. 8A to 8D show details of the flat lock storage unit 100 in themodified example of the first embodiment. The flat lock storage unit 100includes the area usage type storage area 115 for storing an area usagetype, the exclusion right storage area 125 for storing prioritizedexclusion right information, and the information processing unitidentification information storage area 135 for storing non-prioritizedexclusion right information. The area usage type information is binaryinformation indicating which of the prioritized information processingunit information and the non-prioritized exclusion right information theinformation processing unit identification information storage area 135stores. In other words, the size of the area usage type storage area 115is, for example, one bit.

FIG. 8A shows an example of the flat lock storage unit 100 at the timewhen the contended resource 50 is initialized. The area usage typestorage area 115 stores “prioritized information processing unit”indicating that the information processing unit identificationinformation storage area 135 stores prioritized information processingunit information. The exclusion right storage area 125 stores “unlocked”indicating that the prioritized information processing unit 150 is nottrying to acquire the contended resource 50. The information processingunit identification information storage area 135 stores “ID1” asinformation for identifying the prioritized information processing unit150.

FIG. 8B shows the state where the prioritized information processingunit 150 has tried to acquire the contended resource 50 in FIG. 8A. Theexclusion right storage area 125 stores “locked” indicating that theprioritized information processing unit 150 has tried to acquired thecontended resource 50.

FIG. 8C shows the state where the non-prioritized information processingunit 160-1 has acquired the non-prioritized exclusion right in FIG. 8A.The area usage type storage area 115 stores “non-prioritized exclusionright” indicating that the information processing unit identificationinformation storage area 135 stores non-prioritized exclusion rightinformation. The information processing unit identification informationstorage area 135 stores ID2 as information for identifying thenon-prioritized information processing unit 160-1, in order to indicatethat the non-prioritized exclusion right has been acquired by thenon-prioritized information processing unit 160-1.

Here, in order to change the state of FIG. 8A into the state of FIG. 8C,the non-prioritized information processing unit 160-1 executes thefollowing process to the exclusion of the other information processingunits. First, the non-prioritized information processing unit 160-1checks whether “nobody” indicating that none of the informationprocessing units has acquired the contended resource 50 is stored in theinformation processing unit identification information storage area 135,and at the same time, whether “unlocked” is stored in the exclusionright storage area 125. Then, if both results are YES, ID2 is stored inthe information processing unit identification information storage area135, and “locked” is stored in the exclusion right storage area 125. Itis desirable that this series of processes are executed by using acompare-and-swap instruction or the like to the exclusion of the otherinformation processing units. Even if a compare-and-swap instruction isapplicable only to one word on memory, the non-prioritized informationprocessing unit 160-1 can appropriately execute a process for acquiringthe non-prioritized exclusion right by setting the exclusion rightstorage area 125 and the information processing unit identificationinformation storage area 135 as continuous areas as shown in the presentembodiment.

FIG. 8D shows the state where the non-prioritized exclusion right hasbeen released by the non-prioritized information processing unit 160-1in FIG. 8C. The information processing unit identification informationstorage area 135 stores “nobody.”

As described above, the flat lock storage unit 100 in the presentexample has a small size compared to the flat lock storage unit 100 inFIG. 1. Accordingly, the exclusion controller 10 of the present modifiedexample can appropriately arbitrate the acquisition of the contendedresource 50 by using a smaller storage area than that of the exclusioncontroller 10 in FIG. 1, while allowing the prioritized informationprocessing unit 150 to operate at a higher speed than thenon-prioritized information processing unit 160 similarly to FIG. 1.

FIG. 9 is an operation flow where the prioritized information processingunit 150 or the non-prioritized information processing unit 160 tries toacquire the contended resource in the modified example of the firstembodiment. In some parts of this flow, both the prioritized informationprocessing unit 150 and the non-prioritized information processing unit160 operate in almost the same manner. Accordingly, in such parts, theprioritized information processing unit 150 and the non-prioritizedinformation processing unit 160 are generically referred to asinformation processing units.

When an information processing unit tries to acquire the contendedresource 50, the information processing unit checks whether theinformation processing unit identification information storage area 135stores the ID for identifying the information processing unit (S600). Ifthe information processing unit identification information storage area135 stores the ID for identifying the information processing unit (S600:YES), the prioritized information processing unit 150 stores “locked” inthe exclusion right storage area 125. The prioritized informationprocessing unit 150 then reads the information processing unitidentification information storage area 135 again. If the prioritizedinformation processing unit 150 has checked that the information in theinformation processing unit identification information storage area 135has not changed from the information at the time of S600 (S620: YES),the contended resource 50 is successfully acquired (S630), and theprocess comes to an end. On the other hand, if the prioritizedinformation processing unit 150 has checked that the information in theinformation processing unit identification information storage area 135has changed from the information at the time of S600 (S620: NO), theprioritized information processing unit 150 removes “locked” from theexclusion right storage area 125 to store “unlocked” therein. In thiscase, the prioritized information processing unit 150 fails to acquirethe contended resource 50 (S650), and the process comes to an end.

If the information processing unit identification information storagearea 135 does not store the ID for identifying the informationprocessing unit (S600: NO), the non-prioritized information processingunit 160 checks whether an ID other than “nobody” is stored in theinformation processing unit identification information storage area 135(S660). If an ID other than “nobody” is stored in the informationprocessing unit identification information storage area 135 (S660: YES),the non-prioritized information processing unit 160 tries to acquire thenon-prioritized exclusion right to the exclusion of the othernon-prioritized information processing units (S670). If the acquisitionhas failed (S680: NO), the information processing unit fails to acquirethe contended resource 50 (S650), and the process comes to an end. Onthe other hand, if the non-prioritized exclusion right has beensuccessfully acquired (S680: YES), the information processing unitstores, in the area usage type storage area 115, information indicatingthat the information processing unit identification information storagearea 135 stores non-prioritized exclusion right information (S690). Inthis case, the information processing unit succeeds in acquiring thecontended resource 50 (S630), and the process comes to an end.

If “nobody” is stored in the information processing unit identificationinformation storage area 135 (S660: NO), the non-prioritized informationprocessing unit 160 tries to acquire the non-prioritized exclusion rightto the exclusion of the other non-prioritized information processingunits (S700). If the acquisition has failed (S710: NO), thenon-prioritized information processing unit 160 fails to acquire thecontended resource 50 (S730), and the process comes to an end. On theother hand, if the non-prioritized exclusion right has been successfullyacquired (S710: YES), the non-prioritized information processing unit160 succeeds in acquiring the contended resource 50 (S720), and theprocess comes to an end. The information processing unit may operate byusing a spin lock in which the above-described operations are repeateduntil the contended resource 50 is successfully acquired, or may executea process for transitioning to another locking method if the acquisitionof the contended resource 50 has failed.

As described above, when only the prioritized information processingunit 150 has acquired the contended resource 50, the exclusioncontroller 10 allows the prioritized information processing unit 150 toacquire the contended resource 50 by writing on the flat lock storageunit 100, thus enabling fast operations. On the other hand, even whenthe non-prioritized information processing unit 160 has acquired thecontended resource 50, the exclusion controller 10 can appropriatelyarbitrate the acquisition of the contended resource 50.

Second Embodiment

FIG. 10 is a function block diagram of an exclusion controller 20 in asecond embodiment. The exclusion controller 20 includes a contendedresource 60, a resource information storage area 300, a prioritizedinformation processing unit 340 as an example of a first thread,non-prioritized information processing units 350-1 to 350-N as examplesof a second thread, an execution state acquisition/notification unit390, and a monitor control unit 410. The exclusion controller 20 has anobject to arbitrate the acquisition of the contended resource 60 amongthe prioritized information processing unit 340 and the non-prioritizedinformation processing units 350-1 to 350-N.

The contended resource 60 is a resource to be exclusively acquired byany one of the prioritized information processing unit 340 and thenon-prioritized information processing units 350-1 to 350-N, whichasynchronously operate. Other details of the contended resource 60 arealmost the same as those of the contended resource 50 described inFIG. 1. Therefore, a description thereof will be omitted.

The resource information storage area 300 has a priority rightinformation field 310, a recursive acquisition phase field 320, and amode type field 330. The priority right information field 310 storespriority right information indicating that the prioritized informationprocessing unit exists. For example, the priority right information isinformation (thread ID or the like) for identifying the prioritizedinformation processing unit. If no information processing unit is set asthe prioritized information processing unit, the priority rightinformation field 310 stores anonymous state information indicating thatno information processing unit is set as the prioritized informationprocessing unit. The recursive acquisition phase field 320 storesresource information indicating whether the contended resource 60 hasbeen acquired by any one of the plurality of information processingunits. The mode type field 330 stores mode type information identifyingeither a priority mode or a normal mode. In the priority mode, theresource information storage area 300 is used for acquiring thecontended resource 60. In the normal mode, the monitor control unit 410is used for acquiring the contended resource 60.

If the mode type information stored in the mode type field 330 indicatesthe priority mode, the prioritized information processing unit 340executes the following process. First, the prioritized informationprocessing unit 340 executes, as an example of the second processaccording to the present invention, a process for reading the contentsof the priority right information field 310 and writing resourceinformation in the recursive acquisition phase field 320 if priorityright information is stored in the priority right information field 310,thereby acquiring the contended resource 60. On the other hand, ifanonymous state information is stored in the priority right informationfield 310, the prioritized information processing unit 340 exclusivelywrites information for identifying the prioritized informationprocessing unit 340 in the priority right information field 310.

On the other hand, if the mode type information stored in the mode typefield 330 indicates the normal mode, the prioritized informationprocessing unit 340 acquires the contended resource 60 by notifying themonitor control unit 410 that the prioritized information processingunit 340 tries to acquire the contended resource 60, instead of theabove-described process.

Moreover, if the mode type information stored in the mode type field 330indicates the priority mode, the prioritized information processing unit340 releases the contended resource 60 by removing resource informationfrom the recursive acquisition phase field 320. On the other hand, ifthe mode type information stored in the mode type field 330 indicatesthe normal mode, the prioritized information processing unit 340releases the contended resource 60 by transmitting directions to releasethe contended resource 60 to the monitor control unit 410.

The non-prioritized information processing unit 350-1 has a prioritizedinformation processing unit stop unit 360, a priority right removal unit370, a transient state check unit 380, and an execution state settingunit 400. When the non-prioritized information processing unit 350-1acquires the contended resource 60, the prioritized informationprocessing unit stop unit 360 first stops the prioritized informationprocessing unit 340. Next, the prioritized information processing unitstop unit 360 notifies the priority right removal unit 370 and thetransient state check unit 380 that the prioritized informationprocessing unit stop unit 360 has stopped the prioritized informationprocessing unit 340.

For example, when the information processing units are threads, theprioritized information processing unit stop unit 360 may stop theprioritized information processing unit 340 by calling the SuspendThreadfunction. Instead of this, with an interrupt handler previously providedin the prioritized information processing unit 340, the prioritizedinformation processing unit stop unit 360 suspends the process of theprioritized information processing unit 340 by interrupting theprioritized information processing unit 340. In this case, the processeshandled by the priority right removal unit 370, the transient statecheck unit 380, and the execution state setting unit 400 may be executedin the interrupt handler of the prioritized information processing unit340.

When the priority right removal unit 370 is notified from theprioritized information processing unit stop unit 360 that theprioritized information processing unit stop unit 360 has stopped theprioritized information processing unit 340, the priority right removalunit 370 acquires an exclusive access right, which is an example of anon-prioritized exclusion right, to the resource information storagearea 300. The priority right removal unit 370 then removes priorityright information from the priority right information field 310, storesinformation used by the monitor control unit 410 in the priority rightinformation field 310 and the recursive acquisition phase field 320, andstores mode type information indicating the normal mode in the mode typefield 330.

When the transient state check unit 380 is notified from the prioritizedinformation processing unit stop unit 360 that the prioritizedinformation processing unit stop unit 360 has stopped the prioritizedinformation processing unit 340, the transient state check unit 380transmits directions to acquire the execution state of the prioritizedinformation processing unit 340 to the execution stateacquisition/notification unit 390. If the transient state check unit 380has checked, based on the execution state received from the executionstate acquisition/notification unit 390, that the stopped prioritizedinformation processing unit 340 is executing the second process, i.e.that the stopped prioritized information processing unit 340 isexecuting a process for acquiring or releasing the contended resource 60without using an indivisible instruction, such as a compare-and-swapinstruction, then the transient state check unit 380 transmits the checkresult to the execution state setting unit 400.

When the execution state acquisition/notification unit 390 receivesdirections to acquire the execution state of the prioritized informationprocessing unit 340, from the transient state check unit 380, theexecution state acquisition/notification unit 390 acquires, from theprioritized information processing unit 340, the execution statethereof, e.g. execution location information indicating the executionlocation of a program in the prioritized information processing unit340. The execution state acquisition/notification unit 390 thentransmits the execution state of the prioritized information processingunit 340 to the transient state check unit 380, thereby notifying thenon-prioritized information processing unit 350 of the execution stateof the prioritized information processing unit 340. The executionlocation information is, for example, a program counter in theprioritized information processing unit 340. Instead of this, theexecution state acquisition/notification unit 390 may acquireinformation for identifying a function currently being executed by theprioritized information processing unit 340, or may acquire the value ofa predetermined register in the prioritized information processing unit340.

When the execution state setting unit 400 has received from thetransient state check unit 380 the check result indicating that theprioritized information processing unit 340 is executing the secondprocess, the execution state setting unit 400 sets the execution stateof the prioritized information processing unit 340 to the state wherethe prioritized information processing unit 340 is not acquiring thecontended resource 60 by using the second process. For example, theexecution state setting unit 400 sets the execution state of theprioritized information processing unit 340 to the state before theprioritized information processing unit 340 reads the contents of thepriority right information field 310. The execution state setting unit400 then allows the prioritized information processing unit 340 toresume operations.

If the processes handled by the priority right removal unit 370 and theexecution state setting unit 400 are completed, the non-prioritizedinformation processing unit 350-1 tries to acquire the contendedresource 60 by notifying the monitor control unit 410 that thenon-prioritized information processing unit 350-1 tries to acquire thecontended resource 60. On the other hand, the non-prioritizedinformation processing unit 350-1 releases the contended resource 60 bynotifying the monitor control unit 410 of directions to release thecontended resource 60. Note that operations of the non-prioritizedinformation processing units 350-2 to 350-N are almost the same as thoseof the non-prioritized information processing unit 350-1 and therefore adescription thereof will be omitted.

When the monitor control unit 410 receives, from each of the prioritizedinformation processing unit 340 and the non-prioritized informationprocessing units 350-1 to 350-N, a notice indicating that theinformation processing unit tries to acquire the contended resource 60,the monitor control unit 410 allows any one of the prioritizedinformation processing unit 340 and the non-prioritized informationprocessing units 350-1 to 350-N to acquire the contended resource 60. Inthis case, the monitor control unit 410 uses the priority rightinformation field 310 and the recursive acquisition phase field 320 asneeded. When the monitor control unit 410 receives directions to releasethe contended resource 60, from each of the prioritized informationprocessing unit 340 and the non-prioritized information processing units350-1 to 350-N, the monitor control unit 410 releases the contendedresource 60, and allows another information processing unit waiting inorder to acquire the contended resource 60, to acquire the contendedresource 60. An example of a process in which the monitor control unit410 arbitrates the acquisition of the contended resource 60 is almostthe same as that of the monitor control unit 190 in FIG. 1. Therefore, adescription thereof will be omitted.

As described above, when only the prioritized information processingunit 340 tries to acquire the contended resource 60, the exclusioncontroller 20 can allow the prioritized information processing unit 340to acquire the contended resource 60 by reading the resource informationstorage area 300 and writing in the resource information storage area300 without using an indivisible instruction, such as a compare-and-swapinstruction, which requires a long processing time. Therefore, theexclusion controller 20 can allow the prioritized information processingunit 340 to acquire and release the contended resource 60 at a highspeed.

Moreover, when the non-prioritized information processing unit 350 triesto acquire the contended resource 60, the exclusion controller 20 canarbitrate the acquisition of the contended resource 60 in order toensure exclusive access to the contended resource 60.

FIGS. 11A to 11D shows details of the resource information storage area300 in the second embodiment. FIG. 11A shows the initial state of theresource information storage area 300 when the contended resource 60 hasbeen initialized, for example. The priority right information field 310stores “0” indicating that priority right information is not set, i.e.indicating anonymous state information. The recursive acquisition phasefield 320 stores “0” indicating that the contended resource 60 is notacquired. The mode type field 330 stores “1” indicating the prioritymode.

FIG. 11C shows the state where the prioritized information processingunit 340 has acquired the contended resource 60 in FIG. 11A. Theprioritized information processing unit 340 writes “A,” which isinformation for identifying the prioritized information processing unit340, in the priority right information field 310. The prioritizedinformation processing unit 340 writes “1” indicating that theprioritized information processing unit 340 has acquired the contendedresource 60, in the recursive acquisition phase field 320. Note that theprioritized information processing unit 340 may further recursivelyacquire the contended resource 60 having already been acquired, as shownin FIGS. 11C′ to 11C″.

FIG. 11B shows the state where the prioritized information processingunit 340 has released the contended resource 60 in FIG. 11C. Theprioritized information processing unit 340 releases the contendedresource 60 by writing “0” indicating that the contended resource 60 isnot acquired, in the recursive acquisition phase field 320. Note that,if it is previously predicted that the contended resource 60 isfrequently acquired by a specific information processing unit, the stateshown in FIG. 11B may be set as the initial state of the resourceinformation storage area 300. Moreover, if it is previously predictedthat contention tends to occur in the acquisition of the contendedresource 60, the state shown in FIG. 11D may be set as the initial stateof the resource information storage area 300.

As described above, in a reservation state, which is a state where onlythe prioritized information processing unit 340 tries to acquire thecontended resource 60, the prioritized information processing unit 340can execute a process for acquiring and releasing the contended resource60 by rewriting the value in the recursive acquisition phase field 320.In this case, it is ensured that the prioritized information processingunit 340 can access the resource information storage area 300 to theexclusion of the other information processing units. Accordingly, theprioritized information processing unit 340 can acquire the contendedresource 60, without using a compare-and-swap instruction or the likerequiring a long processing time, by read and write instructionsrequiring shorter processing times than the compare-and-swap instructionand the like.

FIG. 11D shows the state where the non-prioritized informationprocessing unit 350-1 has tried to acquire the contended resource 60 inFIG. 11B or 11C. When the non-prioritized information processing unit350-1 tries to acquire the contended resource 60, the non-prioritizedinformation processing unit 350-1 acquires an exclusive access right tothe resource information storage area 300. This is to avoid duplicateprocesses for transitioning to the normal mode by the non-prioritizedinformation processing unit 350-1 and the other non-prioritizedinformation processing units which may try to acquire the contendedresource 60.

The priority right removal unit 370 stores mode type informationindicating the normal mode, i.e. “0” in the mode type field 330, andalso stores monitor information used by the monitor control unit 410 inthe normal mode, in the priority right information field 310 and therecursive acquisition phase field 320. Instead of this, if the size ofthe information used in the normal mode is larger than the total size ofthe priority right information field 310 and the recursive acquisitionphase field 320, the priority right removal unit 370 may generate amonitor structure for storing the monitor information used in the normalmode, in a predetermined area in a memory, thus storing informationindicating the location of the monitor structure in the priority rightinformation field 310 and the recursive acquisition phase field 320.

FIG. 12 is an operation flow where the prioritized informationprocessing unit 340 or the non-prioritized information processing unit350 tries to acquire the contended resource in the second embodiment. Insome parts of this drawing, both the prioritized information processingunit 340 and the non-prioritized information processing unit 350 operatein almost the same manner. Therefore, in such parts, the prioritizedinformation processing unit 340 and the non-prioritized informationprocessing unit 350 are generically referred to as informationprocessing units. When an information processing unit receivesdirections to acquire the contended resource 60, the informationprocessing unit first reads the resource information storage area 300(S800). If the information processing unit has checked, based on theread information, that the acquisition mode of the contended resource 60is set to the normal mode (S810: NO), the information processing unittries to acquire the contended resource 60 by the monitor mode using themonitor control unit 410 (S820).

On the other hand, if the information processing unit has checked thatthe acquisition mode of the contended resource 60 is set to the prioritymode (S810: YES), the information processing unit checks whether thepriority right information field 310 stores anonymous state information(S830). If anonymous state information is stored therein (S830: YES),the information processing unit tries to write, in the resourceinformation storage area 300, priority right information indicating thatthe information processing unit is the prioritized informationprocessing unit 340 and resource information indicating that theinformation processing unit has acquired the contended resource 60, tothe exclusion of the other information processing units (S840). In otherwords, the exclusion controller 20 sets as the prioritized informationprocessing unit 340 the information processing unit which has acquiredthe contended resource 60 first, and sets as the non-prioritizedinformation processing units 350 the other information processing unitsexcept the prioritized information processing unit 340. If the priorityright information and the resource information have been successfullywritten (S850: YES), the information processing unit acquires thecontended resource 60 (S860) to execute other process using thecontended resource 60. If the information processing unit has failed towrite the priority right information and the resource information (S850:NO), the information processing unit returns the process to S800.

If the priority right information field 310 does not store anonymousstate information (S830: NO), the information processing unit checkswhether the information processing unit is the prioritized informationprocessing unit 340, that is, whether information for identifying theinformation processing unit is stored in the priority right informationfield 310 (S870). If the information processing unit is not theprioritized information processing unit 340 (S870: NO), thenon-prioritized information processing unit 350 executes a process forremoving the priority right of the prioritized information processingunit 340 (S880), and then tries to acquire the contended resource 60 bythe monitor mode using the monitor control unit 410 (S890). On the otherhand, if the information processing unit is the prioritized informationprocessing unit 340 (S870: YES), the prioritized information processingunit 340 checks whether the recursive acquisition phase of the contendedresource 60 has reached a limit (S900). If the recursive acquisitionphase has reached the limit (S900: YES), the prioritized informationprocessing unit 340 transitions to the aforementioned process of S880.In other words, if the recursive acquisition phase of the contendedresource 60, which the prioritized information processing unit 340 istrying to newly acquire, exceeds the limit of the recursive acquisition(e.g. the state of FIG. 11C″) capable of being counted by using therecursive acquisition phase field 320 having a predetermined data size,the prioritized information processing unit 340 tries to acquire thecontended resource 60 by the monitor mode tolerant of more phases.

If the recursive acquisition has not reached the limit (S900: YES), theprioritized information processing unit 340 executes a process forupdating the resource information in the recursive acquisition phasefield 320, e.g. a process for adding one to the value already storedtherein. Then, the prioritized information processing unit 340 thenacquires the contended resource 60 (S860) to execute other processesusing the contended resource 60.

FIG. 13 shows an operation flow showing details of S880 in FIG. 12. Theinformation processing unit currently executing this flow checks whetherthe information processing unit is the prioritized informationprocessing unit 340 (S920). If the information processing unit is notthe prioritized information processing unit 340 (S920: NO), theinformation processing unit stops operations of the prioritizedinformation processing unit 340 (S930). Subsequently, the informationprocessing unit reads the contents of the resource information storagearea 300 (S940). The information processing unit checks whether theprocess for removing the priority right has already been completed,based on, for example, whether the mode type information stored in themode type field 330 indicates the normal mode (S950).

If the process for removing the priority right has already beencompleted (S950: YES), the information processing unit allows theprioritized information processing unit to resume operations (S955), andterminates the priority right removal process. On the other hand, if theprocess for removing the priority right has not been completed yet(S950: NO), the information processing unit acquires a right to accessthe resource information storage area 300 to the exclusion of the otherinformation processing units, and writes data necessary for a processfor acquiring the contended resource 60 by the monitor mode, in thepriority right information field 310 and the recursive acquisition phasefield 320 (S960). If the writing has failed (S970: NO), the informationprocessing unit returns to S940. If the writing has succeeded (S970:YES), the information processing unit checks whether the prioritizedinformation processing unit 340 is executing the second process (S980).

If the prioritized information processing unit 340 is executing thesecond process (S980: YES), the execution state setting unit 400 setsthe execution state of the prioritized information processing unit 340to the state where the prioritized information processing unit 340 isnot acquiring the contended resource 60 by using the second process(S990). For example, if the prioritized information processing unit 340is executing a process which starts with reading resource information atS800 of FIG. 12, is followed by sequentially executing S830, S870 andS900, and ends with writing resource information at S910, the executionstate setting unit 400 sets the execution state of the prioritizedinformation processing unit 340 to the state before S800 is executed.Similarly, if the prioritized information processing unit 340 isexecuting a process which starts with reading the resource informationstorage area 300 at S997 of FIG. 14 to be described later and ends withcompleting the release of the contended resource at S1010, the executionstate setting unit 400 sets the execution state of the prioritizedinformation processing unit 340 to the state before S997 is executed.

FIG. 14 shows an operation flow where the prioritized informationprocessing unit 340 or the non-prioritized information processing unit350 releases the contended resource in the second embodiment. In thisdrawing, since the respective operations of the prioritized informationprocessing unit 340 and the non-prioritized information processing unit350 will be collectively described, the prioritized informationprocessing unit 340 and the non-prioritized information processing unit350 are generically referred to as information processing units. When aninformation processing unit receives directions to release the contendedresource 60, the information processing unit first reads the contents ofthe resource information storage area 300 (S997), and refers to the modetype field 330, thereby deciding whether the acquisition mode of thecontended resource 60 is set to the normal mode (S1000).

If the acquisition mode is set to the priority mode (S1000: YES), theinformation processing unit updates resource information by a processfor subtracting one from the value in the recursive acquisition phasefield 320 (S1005) to release the contended resource 60 (S1010). On theother hand, if the acquisition mode is set to the normal mode (S1000:NO), the information processing unit releases the contended resource 60by the monitor mode using the monitor control unit 410 (S1020).

Modified Example

FIG. 15 shows an operation flow showing details of S880 in an modifiedexample of the second embodiment. The operation flow described in thisdrawing has a configuration including S1030 instead of S980 in theoperation flow described in FIG. 13.

The information processing unit writes data necessary for a process foracquiring the contended resource 60 by the monitor mode, in the priorityright information field 310 and the recursive acquisition phase field320 (S960). If the writing has succeeded (S970: YES), the informationprocessing unit invalidates a resource acquisition instruction issued bythe prioritized information processing unit 340 (S1030). The resourceacquisition instruction means, for example, the operations of S910described in FIG. 12 and S1010, i.e. a process for writing resourceinformation in the resource information storage area in order to acquirethe contended resource 60 by the prioritized information processing unit340. Even when the prioritized information processing unit 340 isexecuting the second process, the information processing unit cantransition to the monitor mode by invalidating the resource acquisitioninstruction without allowing the prioritized information processing unit340 to acquire the contended resource 60.

Incidentally, if the information processing unit simply invalidates aresource acquisition instruction (S910) and a resource releaseinstruction (S1010), the prioritized information processing unit 340cannot correctly check whether the prioritized information processingunit 340 has acquired the contended resource 60 at the time when theprocess shown in FIG. 12 has been completed, and whether the prioritizedinformation processing unit 340 has released the contended resource 60at the time when the process shown in FIG. 14 has been completed.Therefore, in addition to invalidating the resource acquisitioninstruction, the information processing unit needs to allow theprioritized information processing unit 340 to retry the acquisition orthe release of the contended resource 60. Accordingly, the exclusioncontroller 20 realizes the invalidation of the instruction the retrialof the acquisition of the contended resource 60 by using a conditionalinstruction execution function utilizing a predicate register. Theconditional instruction execution function utilizing a predicateregister is a function of executing an instruction only when the valueof the predicate register is one. Here, the predicate register isprovided so as to correspond to each instruction of a processor. In thepresent modified example, a predicate register 1 is previously made tocorrespond to the instructions to execute the processes of S910 andS1010. Predicate register 1 is previously set to one. Further, aninstruction to return the process to S800 is previously provided at thelocation executed when S910 has been invalidated. Similarly, aninstruction to return the process to S997 is previously provided at thelocation executed when S1010 has been invalidated. The informationprocessing unit can return the process to S800 and S997 in addition toinvalidating the resource acquisition instruction and the resourcerelease instruction by setting predicate register 1 of the prioritizedinformation processing unit 340 to zero.

FIG. 16 shows an example of the hardware configuration of the exclusioncontroller 10. The exclusion controller 10 according to the presentembodiment includes a CPU peripheral unit, an input/output unit and alegacy input/output unit. The CPU peripheral unit includes a CPU 1000,RAM 1020, a graphic controller 1075 and a display device 1080, which aremutually connected by a host controller 1082. The input/output unitincludes a communication interface 1030, a hard disk drive 1040 and aCD-ROM drive 1060, which are connected to the host controller 1082 by aninput/output controller 1084. The legacy input/output unit includes ROM1010, a flexible disk drive 1050 and an input/output chip 1070, whichare connected to the input/output controller 1084.

The host controller 1082 connects the RAM 1020 with the CPU 1000 and thegraphic controller 1075, which access the RAM 1020 at high transferrates. The CPU 1000 operates based on programs stored in the ROM 1010and the RAM 1020, and controls each unit. The graphic controller 1075acquires image data generated by the CPU 1000 or the like on a framebuffer provided in the RAM 1020, and displays the image data on thedisplay device 1080. Instead of this, the graphic controller 1075 mayinclude a frame buffer for storing image data generated by the CPU 1000or the like, inside the graphic controller 1075.

The input/output controller 1084 connects the host controller 1082, thecommunication interface 1030, the hard disk drive 1040, the CD-ROM drive1060 and a storage device interface 1085, which are relativelyhigh-speed input/output devices. The communication interface 1030communicates with other devices through a network. The hard disk drive1040 stores programs and data used by the exclusion controller 10. TheCD-ROM drive 1060 reads a program or data from a CD-ROM 1095 to providethe program the data to the RAM 1020 through the input/output controller1084.

Moreover, the ROM 1010 and relatively low-speed input/output devices,such as the flexible disk drive 1050 and the input/output chip 1070, areconnected to the input/output controller 1084. The ROM 1010 stores aboot program executed by the CPU 1000 when the exclusion controller 10is started up, programs depending on the hardware of the exclusioncontroller 10, and the like. The flexible disk drive 1050 reads aprogram or data from a flexible disk 1090 to provide the program or thedata to the RAM 1020 through the input/output controller 1084. Theinput/output chip 1070 is connected to the flexible disk 1090 andvarious input/output devices through, for example, a parallel port, aserial port, a key board port, a mouse port, and the like.

A program provided to the exclusion controller 10 is provided by a userin the state where the program is stored on a recording medium, such asthe flexible disk 1090, the CD-ROM 1095, or an IC card. The program isread from the recording medium, installed in the exclusion controller 10through the input/output controller 1084, and executed in the exclusioncontroller 10.

The program installed and executed in the exclusion controller 10includes a prioritized information processing module, a non-prioritizedinformation processing module, an acquisition check module, aprioritized information processing unit change module, a monitor controlmodule, a full stop module. Operations which are executed by theexclusion controller 10 actuated by each module are similar to those ofthe corresponding members in the exclusion controller 10 described inFIGS. 1 to 9. Therefore, a description thereof will be omitted.

Incidentally, since the hardware configuration of the exclusioncontroller 20 is almost the same as that shown in FIG. 16, a descriptionthereof will be omitted. A program installed and executed in theexclusion controller 20 includes a prioritized information processingmodule, a non-prioritized information processing module, a prioritizedinformation processing unit stop module, a priority right removalmodule, a transient state check module, an execution stateacquisition/notification module, an execution state setting module, anda monitor control module. Operations which are executed by the exclusioncontroller 20 actuated by each module are similar to those of thecorresponding members in the exclusion controller 20 described in FIGS.10 to 15. Therefore, a description thereof will be omitted.

The above-described programs and modules may be stored on an externalrecording medium. An optical recording medium including a DVD and a PD,a magneto-optical recording medium including an MD, a tape medium, asemiconductor memory including an IC card, and the like can be used asthe recording medium, in addition to the flexible disk 1090 and theCD-ROM 1095. Moreover, a storage device, such as a hard disk drive orRAM, which is provided in a server system connected to a dedicatedcommunication network or the Internet, may be used as the recordingmedium to provide a program to the exclusion controller 10 through thenetwork.

Although the present invention has been described by using theembodiments, the technical scope of the present invention is not limitedto the scope described in the aforementioned embodiments. Variousmodifications and improvements can be made to the aforementionedembodiments. From the appended claims, it is apparent that aspects inwhich such modifications and improvements are made to the embodimentscan be also included in the technical scope of the present invention.

According to the previously described embodiments, a storage device, aprogram for controlling the storage device, a method for controlling thestorage device, and a recording medium which are shown in the followingrespective items can be realized.

As apparent from the above description, according to the presentinvention, when only a specific information processing unit frequentlyacquires and releases a contended resource, high-speed acquisition ofthe contended resource is enabled while ensuring the exclusivity ofacquisition of the contended resource.

Although the preferred embodiments of the present invention have beendescribed in detail, it should be understood that various changes,substitutions and alternations can be made therein without departingfrom spirit and scope of the inventions as defined by the appendedclaims. These all solve the above-described problem with the previousart. This aspects can be achieved by combinations of features describedin the appended independent claims. Moreover, the appended dependentclaims specify more advantageous concrete examples of the presentinvention.

Variations described for the present invention can be realized in anycombination desirable for each particular application. Thus particularlimitations, and/or embodiment enhancements described herein, which mayhave particular advantages to the particular application need not beused for all applications. Also, not all limitations need be implementedin methods, systems and/or apparatus including one or more concepts ofthe present invention.

The present invention can be realized in hardware, software, or acombination of hardware and software. A visualization tool according tothe present invention can be realized in a centralized fashion in onecomputer system, or in a distributed fashion where different elementsare spread across several interconnected computer systems. Any kind ofcomputer system—or other apparatus adapted for carrying out the methodsand/or functions described herein—is suitable. A typical combination ofhardware and software could be a general purpose computer system with acomputer program that, when being loaded and executed, controls thecomputer system such that it carries out the methods described herein.The present invention can also be embedded in a computer programproduct, which comprises all the features enabling the implementation ofthe methods described herein, and which—when loaded in a computersystem—is able to carry out these methods.

Computer program means or computer program in the present contextinclude any expression, in any language, code or notation, of a set ofinstructions intended to cause a system having an information processingcapability to perform a particular function either directly or afterconversion to another language, code or notation, and/or reproduction ina different material form.

Thus the invention includes an article of manufacture which comprises acomputer usable medium having computer readable program code meansembodied therein for causing a function described above. The computerreadable program code means in the article of manufacture comprisescomputer readable program code means for causing a computer to effectthe steps of a method of this invention. Similarly, the presentinvention may be implemented as a computer program product comprising acomputer usable medium having computer readable program code meansembodied therein for causing a function described above. The computerreadable program code means in the computer program product comprisingcomputer readable program code means for causing a computer to effectone or more functions of this invention. Furthermore, the presentinvention may be implemented as a program storage device readable bymachine, tangibly embodying a program of instructions executable by themachine to perform method steps for causing one or more functions ofthis invention.

It is noted that the foregoing has outlined some of the more pertinentobjects and embodiments of the present invention. This invention may beused for many applications. Thus, although the description is made forparticular arrangements and methods, the intent and concept of theinvention is suitable and applicable to other arrangements andapplications. It will be clear to those skilled in the art thatmodifications to the disclosed embodiments can be effected withoutdeparting from the spirit and scope of the invention. The describedembodiments ought to be construed to be merely illustrative of some ofthe more prominent features and applications of the invention. Otherbeneficial results can be realized by applying the disclosed inventionin a different manner or modifying the invention in ways known to thosefamiliar with the art.

1. A method for managing exclusion control on an information processingsystem, the method comprising: storing a first set of information in aprioritized information processing unit information storage area,wherein the first set of information identifies a prioritizedinformation processing unit that is to execute writes for acquiring acontended resource by using normal write instructions; storing a secondset of information in a prioritized exclusion right information storagearea, wherein the second set of information indicates whether theprioritized information processing unit is trying to acquire thecontended resource; storing a third set of information in anon-prioritized exclusion right information storage area, wherein thethird set of information is non-prioritized exclusion right informationthat indicates whether a non-prioritized exclusion right has beenacquired by a non-prioritized information processing unit; mutuallyexclusively acquiring, by a plurality of non-prioritized informationprocessing units, a non-prioritized exclusion right by a first processusing the third set of information in the non-prioritized exclusionright information storage area; determining, based on mutuallyexclusively acquiring the non-prioritized exclusion right by the firstprocess, that the non-prioritized exclusion right information has notyet been stored, wherein the first process executes writes by usingcompare-and-swap instructions, and where the non-prioritized exclusionright indicates a candidate for acquiring the contended resource; andacquiring, by the prioritized information processing unit, the contendedresource by a second process to an exclusion of the non-prioritizedinformation processing unit having acquired the non-prioritizedexclusion right, the exclusion being determined from the non-prioritizedexclusion right information storage area, updating the information inthe prioritized exclusion right information storage area to indicatethat the prioritized information processing unit is trying to acquirethe contended resource, the second process executing writes by usingnormal write instructions.
 2. The method of claim 1, further comprising:executing as the first process, by each non-prioritized informationprocessing unit, a process for storing the non-prioritized exclusionright information indicating that the non-prioritized informationprocessing unit has acquired the non-prioritized exclusion right, to theexclusion of the other non-prioritized information processing units ifthe non-prioritized exclusion right information has not yet stored, andexecuting as the second process, by the prioritized informationprocessing unit, a process for storing the prioritized exclusion rightinformation and then reading the non-prioritized exclusion right storagearea, and acquires the contended resource if the non-prioritizedexclusion right information is not stored, but does not acquire thecontended resource if the non-prioritized exclusion right informationhas already stored.
 3. The method of claim 2, further comprising:storing a fourth set of information in an area usage type storage area,wherein the fourth set of information indicates which of thenon-prioritized exclusion right information or prioritized informationprocessing unit information indicated by the first set of informationthe non-prioritized exclusion right storage area stores, storing, by thenon-prioritized exclusion right storage area, any one of thenon-prioritized exclusion right information and the first set ofinformation indicating which of the plurality of information processingunits is the prioritized information processing unit, and acquiring, byeach of the prioritized information processing unit and the plurality ofnon-prioritized information processing units, the non-prioritizedexclusion right by the first process if the non-prioritized exclusionright storage area stores the non-prioritized exclusion rightinformation, and the information processing unit acquires the contendedresource if the information processing unit has acquired thenon-prioritized exclusion right.
 4. The method of claim 2, furthercomprising: checking, by an acquisition check unit, whether theacquisition of the contended resource by any one of the first and secondprocesses has failed; and executing, by a monitor control unit,exclusion control by a monitor mode in which all the informationprocessing units waiting to acquire the contended resource arepreviously recorded and the information processing unit having releasedthe contended resource notifies the information processing units waitingto acquire the contended resource that the contended resource has beenreleased, if a check has been made that the acquisition of the contendedresource has failed.
 5. The method of claim 1, further comprisingchanging, by a prioritized information processing unit change unit, theprioritized information processing unit into a non-prioritizedinformation processing unit if non-prioritized exclusion rightinformation has been already stored, in the second process.
 6. Themethod of claim 1, further comprising: storing in the prioritizedinformation processing unit information storage area prioritizedinformation processing unit information indicating which of theinformation processing units is the prioritized information processingunit; and allowing, by a prioritized information processing unit settingunit, any one of the plurality of information processing units toexecute a process for storing, in the prioritized information processingunit information storage area, the prioritized information processingunit information indicating that the information processing unit is theprioritized information processing unit, to the exclusion of the otherinformation processing units if the prioritized information processingunit information has not been stored.
 7. The method of claim 1, furthercomprising: setting, by a prioritized information processing unitsetting unit, the information processing unit having first acquired thecontended resource as the prioritized information processing unit andfor setting the other information processing units except theprioritized information processing unit as the non-prioritizedinformation processing units.
 8. The method of claim 1, furthercomprising: storing, in a resource information storage area, resourceinformation indicating whether the contended resource has been acquiredby any one of the plurality of information processing units, whileassociating the resource information with priority right informationindicating that the prioritized information processing unit exists; andexecuting, by the prioritized information processing unit, as the secondprocess, a process for reading information from the resource informationstorage area and for writing the resource information in the resourceinformation storage area if the priority right information is stored,and wherein each non-prioritized information processing unit: stops theprioritized information processing unit; removes the priority rightinformation from the resource information storage area by the firstprocess exclusively from the other information processing units afterthe prioritized information processing unit has been stopped; checkswhether the prioritized information processing unit which has beenstopped is executing the second process; and sets an execution state ofthe prioritized information processing unit to a state in which theprioritized information processing unit is not acquiring the contendedresource by the second process, if a check has been made that theprioritized information processing unit is executing the second process.9. The method of claim 8, wherein setting an execution state of theprioritized information processing unit further comprises: setting theexecution state by setting execution location information indicating anexecution location of a program realizing the prioritized informationprocessing unit to be in a state before the resource information storagearea is read.
 10. The method of claim 9, further comprising: changing,by a prioritized information processing unit change unit, any one of thenon-prioritized information processing units into the prioritizedinformation processing unit.
 11. The method of claim 10, furthercomprising: stopping, by a full stop unit, all of the plurality ofinformation processing units, wherein the prioritized informationprocessing unit change unit changes the non-prioritized informationprocessing unit having acquired the contended resource at the time whenall of the plurality of information processing units are stopped, intothe prioritized information processing unit.
 12. The method of claim 8,further comprising: invalidating, by the prioritized informationprocessing unit, a process for writing in the resource informationstorage area in the second process.
 13. The method of claim 8, furthercomprising: executing, by a monitor control unit, exclusion control by amonitor mode in which all the information processing units waiting toacquire the contended resource are previously recorded and theinformation processing unit having released the contended resourcenotifies the information processing units waiting to acquire thecontended resource that the contended resource has been released, ifinformation indicating that the prioritized information processing unitdoes not exist has been stored in the resource information storage area.14. An information processing system for managing exclusion control, theinformation processing system comprising: a memory; a processorcommunicatively coupled to the memory; a plurality of prioritizedinformation processing units; a plurality of non-prioritized informationprocessing units; and an exclusion controller communicatively coupled tothe memory and the processor, wherein the exclusion controller isadapted to: store a first set of information in a prioritizedinformation processing unit information storage area, wherein the firstset of information identifies a prioritized information processing unitthat is to execute writes for acquiring a contended resource by usingnormal write instructions; store a second set of information in aprioritized exclusion right information storage area, wherein the secondset of information indicates whether the prioritized informationprocessing unit is trying to acquire the contended resource; store athird set of information in a non-prioritized exclusion rightinformation storage area, wherein the third set of information isnon-prioritized exclusion right information that indicates whether anon-prioritized exclusion right has been acquired by a non-prioritizedinformation processing unit; select based on at least the second set ofinformation and the third set of information the prioritized informationprocessing unit over a non-prioritized information processing unit inthe plurality of a non-prioritized information processing units toacquire the contended resource; and enable the prioritized informationprocessing unit to acquire the contended resource prior to thenon-prioritized information processing unit by using an acquisitionprocess that operates at a higher speed than an acquisition processallocated to the non-prioritized information processing unit.
 15. Theinformation processing system of claim 14, wherein in response to beingselected to acquire the contended resource the prioritized informationprocessing unit: stores information within the prioritized exclusionright storage area indicating a locked status analyzes the-prioritizedexclusion right information storage area; determines that anon-prioritized information processing unit has stored informationwithin the non-prioritized exclusion right information storage area; andremoving the information that has been stored within the prioritizedexclusion right storage area indicating a locked status in response todetermining that a non-prioritized information processing unit hasstored information within the non-prioritized exclusion rightinformation storage area.
 16. A physically embodied computer readablemedium for managing exclusion control, the physically embodied computerreadable medium comprising instructions for: storing a first set ofinformation in a prioritized information processing unit informationstorage area, wherein the first set of information identifies aprioritized information processing unit that is to execute writes foracquiring a contended resource by using normal write instructions;storing a second set of information in a prioritized exclusion rightinformation storage area, wherein the second set of informationindicates whether the prioritized information processing unit is tryingto acquire the contended resource; storing a third set of information ina non-prioritized exclusion right information storage area, wherein thethird set of information is non-prioritized exclusion right informationthat indicates whether a non-prioritized exclusion right has beenacquired by a non-prioritized information processing unit; selectingbased on at least the second set of information and the third set ofinformation the prioritized information processing unit over anon-prioritized information processing unit in a plurality ofnon-prioritized information processing units to acquire the contendedresource; and enabling the prioritized information processing unit toacquire the contended resource prior to the non-prioritized informationprocessing unit by using an acquisition process that operates at ahigher speed than an acquisition process allocated to thenon-prioritized information processing unit.